package com.mineoj.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mineoj.model.dto.newscomment.NewsCommentAddRequest;
import com.mineoj.model.entity.NewsComment;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mineoj.model.entity.User;
import com.mineoj.model.vo.NewsCommentVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 明月
* @description 针对表【news_comment(新鲜事评论)】的数据库操作Service
* @createDate 2025-04-11 19:39:33
*/
public interface NewsCommentService extends IService<NewsComment> {
    /**
     * 添加评论
     * @param newsCommentAddRequest 评论信息
     * @param loginUser 登录用户
     * @return 评论ID
     */
    long doNewsComment(NewsCommentAddRequest newsCommentAddRequest, User loginUser);

    /**
     * 删除评论
     * @param id 评论ID
     * @param loginUser 登录用户
     * @return 是否删除成功
     */
    boolean deleteNewsComment(long id, User loginUser);

    /**
     * 获取评论封装
     * @param newsComment 评论
     * @param loginUser 登录用户
     * @return 评论VO
     */
    NewsCommentVO getNewsCommentVO(NewsComment newsComment, User loginUser);

    /**
     * 分页获取新鲜事评论
     * @param newsCommentPage 分页对象
     * @param request 请求
     * @return 分页结果
     */
    Page<NewsCommentVO> getNewsCommentVOPage(Page<NewsComment> newsCommentPage, HttpServletRequest request);

}
